package org.zerta.troops.common;

import java.io.Serializable;

import org.zerta.troops.utilities.SimpleXStreamWrapper;

public class NetworkMessage implements Serializable {

	private String id;
	private String object;
	private boolean sync;
	

	public NetworkMessage ( String id, Object object, boolean sync ) {
		this.id = id;
		this.object = SimpleXStreamWrapper.toXML(object);
		this.sync = sync;
	}

	public String getId() {
		return id;
	}
	
	public Object getObject() {
		return SimpleXStreamWrapper.fromXML(object);
	}
	
	public boolean isSynchronized() {
		return sync;
	}
}
